
<%@include file="Conectar.jsp" %>
<%@page import="java.sql.ResultSet"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Pet Social</title>
         <link rel="stylesheet" type="text/css" href="css/geral.css">
          <link rel="stylesheet" type="text/css" href="css/caixapostal.css">
          
          <style>
            
#busca{
    width:400px;
    height:40px;
    border: 1px solid blueviolet;
}
#Encontrar{
   height:44px;
   border:1px solid blueviolet;
   background-color:blue;
   color:white;
   
   font-family:monospace;
}
          #tabela2{ 
			position:relative;
			float:left;
			left:0px;
			width:100%;
			top:50px;
			text-align:center;
			
			}
                        
                         .alinhamento{
                            text-align:justify;
                             background-color:whitesmoke;
                        }
                        #meusanimais{
                          font-family:monospace;
                           font-size:20px;
                           color:darkgreen;
                           text-align:justify;  
                        }
                        .tdcor{
                            background-color:whitesmoke;
                        }
                        #historico{
                           font-family:monospace;
                           font-size:14px;
                           color:blue;
                           text-align:center;
                           border:1px solid aqua;
                        }
                         #txt{
                  border:0px;
                  color:white;
                  width:1px;
              }
              .labelusuario{
                            font-family:sans-serif;
                            font-weight: bold;
                            font-size:12px;
                            color:darkseagreen;
                        }
                        #tabelaFiltro{
                            position:absolute;
                            float:left;
                            left:0;
                            top:30px;
                            width:100%;
                            text-align:center;
                        }
                        
                        .direita{
                            text-align:right;
                        }
                        .esquerda{
                            text-align:left;
                        }
                        #s{
                            position:relative;
                            float:left;
                            left:60px;
                            
                        }
          </style>
    </head>
     <body >
   
        
	  <div id="barraMenu">
              <div id="slogan"><img id="desenho" src="img/slogan.jpg"/></div>
              <div id="identidade">
                  <table  id="tabela" border="0"  >
                               
                              
                      <form action="login.jsp" method="post">
                          
                          
                               <tr><td class="tds" colspan="3" >
                                       
                                       <label class="fonteLogin">Caixa de mensagens de:</label><%out.print(session.getAttribute("email")); %></td>
                                    </tr>
                      </form>
			   
			   
                           </table>
              </div>
              
          </div> 
	    <!-- div que limita o tamanho do corpo do documento em 1024 X 768-->
	   <div id="corpo">
	    
		
	       
			 
               <%
                  
                   String id_destinatario =(String)session.getAttribute("id_usuario");
                   
                                    try{
                   String qry="SELECT * FROM petsocial.mensagens WHERE ID_DESTINATARIO='"+id_destinatario+"'";
                  
                   
                   ResultSet rs=sql.executeQuery(qry);
                   
                   
                   
                   
                    boolean result=true;
                   
                   
                   
                   
                   
                    
                    
                   while(rs.next()){
                        
                         
                         out.print("<table border=1 id='tabela2'>"+
                           
                            "<tr><td ><label>Nome</label></td><td><label>Email</label></td><td><label>Telefone</label></td></tr>"+
                             "<tr><td > "+rs.getString("NOME_DESTINATARIO") + "</td><td > "+rs.getString("EMAIL_DESTINATARIO") + "</td><td > "+rs.getString("TELEFONE_DESTINATARIO") + "</td></tr>"
                                 + "<tr><td ><label>Mensagem:</label></td><td colspan='2'> "+rs.getString("MENSAGEM") + "</td></tr>"+
                            
                             "</table><br>" );
                    }
                       
                      
                   
               }catch(Exception e){
                   
               }
                     
	       %>
		     
			 
			 
	   		 
	   </div>
	   
   </body>
</html>
